package com.bcmusic.user;

import entity.IdWorker;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.Bean;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.security.crypto.password.PasswordEncoder;
import tk.mybatis.spring.annotation.MapperScan;

/**
 * @ClassName : UserApplication  //类名
 * @Description :   //描述
 * @Author : YG  //作者
 * @Date: 2020-09-21 19:24  //时间
 */
@SpringBootApplication
@EnableEurekaClient
//其它微服务通过名称调用该微服务需要加上这个
@EnableDiscoveryClient
@EnableFeignClients(basePackages = {"com.bcmusic.file.feign"})
@MapperScan("com.bcmusic.user.dao")
public class UserApplication {

    public static void main(String[] args) {
        SpringApplication.run(UserApplication.class, args);
    }

    @Bean
    public IdWorker idWorker(){
        return new IdWorker(0,1) ;}

    @Bean
    public PasswordEncoder passwordEncoder() {
        return new BCryptPasswordEncoder();
    }
}
